import { createRouter, createWebHistory } from 'vue-router'
import ChatView from '@/views/ChatView.vue'
import WorkbenchView from '@/views/WorkbenchView.vue'
import KnowledgeView from '@/views/KnowledgeView.vue'
import AccountView from '@/views/AccountView.vue'
import KnowledgeBaseView from '@/views/KnowledgeBaseView.vue'
import FileListView from '@/views/FileListView.vue'
import ImageView from '@/views/ImageView.vue'
import KnowledgeChat from '@/views/KnowledgeChat.vue'
import TextView from '@/views/TextView.vue'
const routes = [
  {
    path: '/',
    redirect: '/chat'
  },
  {
    path: '/chat',
    name: 'Chat',
    component: ChatView
  },
  {
    path: '/workbench',
    name: 'Workbench',
    component: WorkbenchView
  },
  {
    path: '/knowledge',
    name: 'Knowledge',
    component: KnowledgeChat
  },
  {
    path: '/account',
    name: 'Account',
    component: AccountView
  },
  {
    path: '/knowledge-base',
    name: 'KnowledgeBase',
    component: KnowledgeBaseView
  },
  {
    path: '/file-list/:knowbaseId/:knowbaseName',
    name: 'FileList',
    component: FileListView,
    props:true
  },
  // 新增图片查看路由
  {
    path: '/images/:file_id',
    name: 'ImageView',
    component: ImageView,
    props: true
  },
  //查看文本路由
   {
    path: '/texts/:file_id',
    name: 'TextView',
    component: TextView,
    props: true
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router